<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="/css/bootstrap.css">
    <link rel="stylesheet" href="/css/bootstrap-theme.css">
    <script src="js/jquery-3.6.0.js" type="application/javascript"></script>
    <script src="js/bootstrap.min.js" type="application/javascript"></script>
    <!--    以上为外部导入的样式和js脚本-->
    <link rel="stylesheet" href="/css/profileCss.css">
    <title th:text="${sectionName}"></title>
</head>
<body>
<div th:insert="navigation :: nav"></div>

<div class="container-fluid" id="box1">
    <div class="row">
        <div class="col-lg-9 col-md-12 col-sm-12">
            <span class="glyphicon glyphicon-list-alt btn-lg" aria-hidden="true"></span>
            <h3 style="display: inline-block" th:text="${sectionName}"></h3>
            <hr>
            <div class="media" th:if="${pagination != null }" th:each="question : ${pagination.getQuestions()}">
                <div class="media-left">
                    <a href="#">
                        <img class="media-object img-rounded" width="55px" th:src="${question.user.getAvatar_url()}">
                    </a>
                </div>
                <div class="media-body">
                    <h4 class="media-heading" th:text="${question.getTitle()}"></h4>
                    <span th:text="${question.getDescription()}"></span>
                    <br>
                    <span class="text-color-999" th:text="${question.getComment_count()}"></span>
                    <span class="text-color-999">条回复·</span>
                    <span class="text-color-999" th:text="${question.getComment_count()}"></span>
                    <span class="text-color-999">个浏览·</span>
                    <span class="text-color-999" th:text="${#dates.format(question.getGmt_create(),'yyyy.MM.dd HH:mm')}"></span>
                </div>
                <hr>
            </div>
            <br>
            <nav aria-label="Page navigation">
                <ul class="pagination">
                    <li th:if="${pagination.showFirstPage}">
                        <a th:href="@{/profile/${section}/(page = 1)}" aria-label="Previous">
                            <span aria-hidden="true">&laquo;</span>
                        </a>
                    </li>
                    <li th:if="${pagination.showPre}">
                        <a th:href="@{/profile/${section}/(page = ${pagination.page - 1})}" aria-label="Previous">
                            <span aria-hidden="true">&lt;</span>
                        </a>
                    </li>
                    <li th:class="${pagination.page == page}? 'active' : '' " th:each="page :${pagination.getPages()}">
                        <a th:href="@{/profile/${section}/(page = ${page})}" th:text="${page}"></a>
                    </li>
                    <li th:if="${pagination.showNext}">
                        <a th:href="@{/profile/${section}/(page = ${pagination.page + 1})}" aria-label="Next">
                            <span aria-hidden="true">&gt;</span>
                        </a>
                    </li>
                    <li th:if="${pagination.showLastPage}">
                        <a th:href="@{/profile/${section}/(page = ${pagination.getTotalPage()})}">
                            <span aria-hidden="true">&raquo;</span>
                        </a>
                    </li>
                </ul>
            </nav>
        </div>
        <div class="col-lg-3 col-md-12 col-sm-12">
            <div class="list-group section">
                <a href="/profile/questions" th:class="${section == 'questions'}? 'list-group-item-info list-group-item' : 'list-group-item' ">我的问题</a>
                <a href="/profile/replies" th:class="${section == 'replies'}? 'list-group-item-info list-group-item' : 'list-group-item' ">最新回复</a>
            </div>
        </div>
    </div>
</div>
</body>
</html>